package com.recruit.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import java.util.Date;

/**
 * 资讯新闻表
 * @TableName info
 */
@Data
@Accessors(chain = true)
@TableName(value ="info")
public class InfoDO{
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 资讯发布人
     */
    @NotEmpty(message = "资讯发布人不能为空")
    @JsonProperty("userId")
    private Integer userId;

    /**
     * 资讯标题
     */
    @NotEmpty(message = "资讯标题不能为空")
    private String title;

    /**
     * 资讯内容
     */
    @NotEmpty(message = "资讯内容不能为空")
    private String content;

    /**
     * 资讯浏览数
     */
    private Integer hits;

    /**
     * 状态标志位
     */
    private Integer state;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JsonProperty("createTime")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JsonProperty("updateTime")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

}